//
//  GXNetTool.h
//  CoolFM
//
//  Created by 曹曹 on 16/8/31.
//  Copyright © 2016年 曹曹. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void(^successBlock)(id result);
typedef void(^failureBlock)(NSError *error);

typedef NS_ENUM(NSUInteger, GXResponseStyle) {
    GXJSON,
    GXDATA,
    GXXML,
};

typedef NS_ENUM(NSUInteger, GXRequestStyle) {
    GXBodyString,
    GXBodyJSON,
};

@interface GXNetTool : NSObject

+(void)GET:(NSString *)url
   andBody:(id)body
 andHeader:(NSDictionary *)headers
andResponse:(GXResponseStyle)responseStyle
andSuccessBlock:(successBlock)success
andFailureBlock:(failureBlock)failure;

+(void)POST:(NSString *)url
    andBody:(id)body
andBodyStyle:(GXRequestStyle)bodyStyle
  andHeader:(NSDictionary *)headers
andResponse:(GXResponseStyle)responseStyle
andSuccessBlock:(successBlock)success
andFailureBlock:(failureBlock)failure;

@end
